package day9;

import org.junit.Test;

public class RegexTest {

    @Test
    public void test1(){
        match("400112", "[0-9]{6}");
        match("13412341234","1[3-9][0-9]{9}");
    }

    public void match(String value, String regex){
        System.out.println("正则:"+regex+",匹配值:"+value+",结果"+value.matches(regex));
    }


    @Test
    public void test2(){
        String s3 = "abc   ads sa sdfa   ".replaceAll("\\s+", "");
        System.out.println(s3);//abcadssasdfa
    }


    @Test
    public void test3(){
        String sidRegex="^\\d{12}$";
        String idRegex="^\\d{17}[0-9Xx]$";
        System.out.println(sidRegex);
        System.out.println(idRegex);
    }
}





